XML columnist Benoit Marchal continues to describe XI, which is an open source project that converts old text into XML. To improve efficiency, Xi now implements the SAX XMLReader interface, which proves that the interface makes XI link to an XSLT
XmlReader provides us with a minimal resource-consuming way to parse XML data by reading the document forward and identifying the read elements. Most of the time we use XmlReader to validate the data validation of an XML file (using the Read ()
XmlReader is used to read XML files, and XmlWriter is used to write data to an XML file. In fact, in the impression that many of the XML operation classes support direct save, read also supports the acceptance of XmlReader and XmlWriter class
. NET Framework class library
XmlReader class
Provides a fast, non-cache, and only-in-access reader for XML data streams, that is, only-in-read-only access to XML data streams. The XmlReader class complies with W3C Extensible Markup Language (XML)
XML Digest
Composition. NET platform is one of the key technologies is XML, here is a simple talk about how to use. NET in the XmlReader.
1. XmlReader Introduction
XmlReader is a fast, buffer-free, forward-read cursor that reads XML documents and
XmlDocument and XElement are going to have to put the entire XML document into memory when reading XML, which is simple, but very costly to memory and IO (possibly disk IO or network IO), while in some scenarios we have to consider saving as much
When reading XML, xmldocument and xelement should put the entire XML file into the memory for operations. This operation is simple, but it is very memory-intensive.And I/O (may be disk I/O or network I/O)In some scenarios, we must consider saving as
1. DOM functions
A, Domdocument->load ()
Role: Loading an XML file
Usage: domdocument->load (string filename)
Parameters: Filename,xml file;
Returns: TRUE if successful, or FALSE if unsuccessful.
B, Domdocument->loadxml ()
Role: Loading XML
1. DOM function
A, Domdocument->load ()Function: Load XML fileUsage: domdocument->load (string filename)Parameters: Filename,xml file;Return: Returns TRUE if successful and FALSE if failed.
B, Domdocument->loadxml ()function: Load XML codeUsage:
Xmlreadersettings is an important class used to verify XML data. We will use this class to verify the XML file later. Here we will first demonstrate how to use xmlreadersettings to configure the attributes of the xmlreader output xmlreadersettings
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.